Skip to content

Conversation

@ammar-agent
Copy link
Collaborator

@ammar-agent ammar-agent commented Dec 8, 2025

Use CSS transform animation (compositor thread) instead of background-position (main thread repaint) to prevent frame drops when compaction summary is streaming.

Changes

  • CompactionBackground: Use translateX transform instead of background-position
  • Add shimmer-slide keyframes to globals.css (runs on compositor thread)
  • Add StreamingCompaction story to visualize the effect

Why this fixes frame drops

CSS transform animations run on the GPU compositor thread, completely off the main JavaScript thread. This matters during streaming when the main thread is busy with React updates and text parsing. In contrast, background-position triggers repaints on every frame.

Generated with mux

@ammar-agent ammar-agent force-pushed the fix-shimmer-compaction-frame-drops branch 2 times, most recently from 8345f5d to b84a3d5 Compare December 8, 2025 18:31
Use CSS transform animation (compositor thread) instead of background-position
(main thread repaint) to avoid frame drops when compaction summary is streaming.

The key insight: CSS transform animations run on the compositor thread,
completely off the main thread. This is important during streaming when
the main thread is busy with React updates and text parsing.

Changes:
- CompactionBackground: Use translateX transform instead of background-position
- Add shimmer-slide keyframes to globals.css
- Add StreamingCompaction story to visualize the effect
- Add createCompactionRequestMessage helper to mockFactory

_Generated with mux_
@ammar-agent ammar-agent force-pushed the fix-shimmer-compaction-frame-drops branch from b84a3d5 to 09c03d4 Compare December 8, 2025 18:35
@ammario ammario merged commit 31c217f into main Dec 8, 2025
19 checks passed
@ammario ammario deleted the fix-shimmer-compaction-frame-drops branch December 8, 2025 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants